package com.xiaouyudeguang.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 业务异常类
 * </p>
 *
 * @author 赵光
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class NoRollbackBusinessException extends Exception {

    private static final long serialVersionUID = 1L;

    /**
     * 异常返回码
     */
    public static final long ERROR_CODE = -1;

    /**
     * 响应码
     */
    private long code;

    public NoRollbackBusinessException() {
        super();
    }

    public NoRollbackBusinessException(long code) {
        super("");
        this.code = code;
    }

    public NoRollbackBusinessException(String message) {
        super(message);
        this.code = ERROR_CODE;
    }

    public NoRollbackBusinessException(long code, String message) {
        super(message);
        this.code = code;
    }

    public NoRollbackBusinessException(Throwable t) throws NoRollbackBusinessException {
        super(t.getMessage());
        this.code = ERROR_CODE;
    }

}